<ion-view title="登陆 | 工程大电子电气学院" class="verify">
    <ion-nav-buttons side="primary">
        <button class="button button-icon button-clear icon ion-home ink ink-dark" ui-sref="app.main"></button>
    </ion-nav-buttons>
    <form name="verify" novalidate>
        
        <h4>{{subTitle}}</h4>
        <p class="msg" ng-class="{err : msg.err}" ng-if="msg.f" ng-bind-html="msg.content"></p>
        <!--input-->
        <input name="phone" placeholder="请输入您的手机号" type="text" required
               ng-model="verifyFields.phone" ng-model-options="{debounce: 500}"
               ng-pattern="/^\d+$/" ng-minlength="11" ng-maxlength="11"
               ng-if="!hasVerified" has-user-mobile>

        <input class="cap-input" name="cap" placeholder="右边写了啥？→" type="text" required
               ng-model="verifyFields.cap" ng-model-options="{debounce: 500}"
               ng-minlength="4" ng-maxlength="6"
               ng-if="!hasVerified && verify.phone.$valid">

        <img ng-src={{capAddr}} alt="cap" class="cap-image" ng-if="!hasVerified && verify.phone.$valid"
             ng-click="chgCap()"/>

        <input name="code" placeholder="短信里写了啥？" type="text" required
               ng-model="verifyFields.code" ng-model-options="{debounce: 500}"
               ng-pattern="/^\d+$/" ng-minlength="6" ng-maxlength="6"
               ng-if="!hasVerified && SMSSent">


        <div class="padding" ng-if="!hasVerified">
            <button class="button button-block button-calm ink ink-dark"
                    ng-disabled="((!verify.phone.$valid || !verify.cap.$valid || !smsResendFlag) && !verify.code.$valid) || ctrl.disable" ng-click="Verify(verify.code.$valid)">
                {{verify.code.$valid ? "开始登陆" : buttonSMSText}}
            </button>
        </div>

    </form>
</ion-view>